# -*- coding: utf-8 -*-
"""
Created on Mon Mar 18 16:00:54 2024

@author: heyuesong
"""

import requests
import pandas as pd
from utils import general

headers = {
    "authority": "www.python-spider.com",
    "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
    "accept-language": "zh-CN,zh;q=0.9",
    "cache-control": "no-cache",
    "pragma": "no-cache",
    "referer": "https://www.python-spider.com/challenge/34",
    "sec-ch-ua": "\"Chromium\";v=\"122\", \"Not(A:Brand\";v=\"24\", \"Google Chrome\";v=\"122\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"Windows\"",
    "sec-fetch-dest": "document",
    "sec-fetch-mode": "navigate",
    "sec-fetch-site": "same-origin",
    "upgrade-insecure-requests": "1",
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36"
}
cookies = {
    "Hm_lvt_337e99a01a907a08d00bed4a1a52e35d": "1709706135,1709706247",
    "sessionid": "h3sjhmrvikm7sczsc0pealsdubqihg5i",
    "Hm_lpvt_337e99a01a907a08d00bed4a1a52e35d": "1710748825",
    "yuanrenxue34": "L9JH6azYVM",
    "iloveu": "c1f7e6458d2e5161a708f98ba8e8aa83d7d898ff"
}
url = "https://www.python-spider.com/challenge/34"
response = requests.get(url, headers=headers, cookies=cookies)

cookies['yuanrenxue34'] = response.cookies.get_dict()['yuanrenxue34']
response = requests.get(url, headers=headers, cookies=cookies)


print(response.text)
print(response)

general.get_encode('parse')


